from django.urls import re_path, path, include
from django.views.static import serve
from django.conf import settings
from rest_framework import routers
from . import views, viewc
from mysqldb.views import DjangoCeleryBeatPeriodictaskViewSet

router = routers.DefaultRouter()
router.register(r"test", views.HelloWorld, basename="00测试页面")
# 模型
router.register(r"botConf", views.AllinpayRobotConfigViewSet, basename="10AI模型列表")
# 个人资料
router.register(r"botList", views.AllinpayRobotListViewSet, basename="11私密好友")
router.register(r"tagList", views.AllinpayRobotTagViewSet, basename="12好友爱好标签")
# 朋友圈
router.register(r"Friends", views.AllinpayRobotFriendsViewSet, basename="13朋友圈文章")
router.register(r"Remark", views.AllinpayRobotRemarkViewSet, basename="14朋友圈评论")
router.register(r"Goods", views.AllinpayRobotGoodsViewSet, basename="15朋友圈点赞")
router.register(r"favorite", views.AllinpayRobotCollectViewSet, basename="16朋友圈收藏")
router.register(r"reprint", views.AllinpayRobotRepeatViewSet, basename="17朋友圈转发")
# 聊天部分
router.register(r"audio", views.UploadLocalViewSet, basename="180音频解析文本")
router.register(r"ChatText", views.RebotTextPostViewSet, basename="181文本AI对话")

# router.register(
#     r"ChatAudio", views.RebotAudioPostViewSet, basename="19文本合成音频(停用)"
# )
# router.register(
#     r"ChatVideo", views.RebotVideoPostViewSet, basename="20音频合成视频(停用)"
# )

# 轮询分布式任务结果
router.register(r"getinfer", views.RebotChatGetViewSet, basename="21提取AI合成任务")
# 分布式服务器接口
router.register(r"postinfer", views.RebotChatPostViewSet, basename="22AI任务(内调)")
router.register(r"audioConf", views.RobotConfigViewSet, basename="23声音模型(内调)")
router.register(r"rebotConf", views.RobotListViewSet, basename="24好友模型(内调)")

# 模板
router.register(
    r"entModels", views.AllinpayRobotModelsViewSet, basename="30订阅事件模板"
)
# 订阅事件
router.register(r"event", views.PeriodicTaskViewSet, basename="31创建订阅事件")
router.register(
    r"myEvent", DjangoCeleryBeatPeriodictaskViewSet, basename="32我的订阅事件"
)
# 停用
router.register(
    r"History", views.AllinpayRobotQiniuViewSet, basename="33历史消息(停用)"
)

# 模板消息测试
router.register(
    r"moneyed", views.AllinpayRobotMoneyTaocanViewSet, basename="40充值套餐"
)
router.register(
    r"doFund", views.AllinpayRobotReqsndofundViewSet, basename="410充值申请退款"
)
router.register(
    r"reFund", views.AllinpayRobotReqsnRefundViewSet, basename="411充值订单退款"
)
router.register(
    r"doClose", views.AllinpayRobotReqsnCloseViewSet, basename="42充值订单关闭"
)
router.register(
    r"doReqsn", views.AllinpayRobotReqsnPostViewSet, basename="43充值订单创建"
)
router.register(r"lsReqsn", views.AllinpayRobotReqsnViewSet, basename="44充值订单查询")
router.register(
    r"myAccount", views.AllinpayRobotAccountViewSet, basename="45用户账户流水"
)
router.register(r"myVerify", views.AllinpayUserVerifyViewSet, basename="46修改特权密码")
# ai模型
router.register(r"myRenew", views.AllinpayRobotListvipViewSet, basename="50模型训练")
router.register(
    r"myShare", views.AllinpayRobotConfigShareViewSet, basename="51模型分享"
)
router.register(
    r"myShareModel", views.myAllinpayRobotConfigShareViewSet, basename="512模型分享列表"
)
router.register(
    r"myScore", views.AllinpayRobotConfigSalesViewSet, basename="52创建模型评分"
)
router.register(
    r"myScoreList",
    views.ModelAllinpayRobotConfigSalesViewSet,
    basename="521查询模型评分",
)
# ai模板订阅
router.register(
    r"meShare", views.AllinpayRobotModelsShareViewSet, basename="53订阅模板分享"
)
router.register(
    r"meScore", views.AllinpayRobotModelsSalesViewSet, basename="54创建订阅模板评分"
)
router.register(
    r"meScoreList",
    views.ModelAllinpayRobotModelsSalesViewSet,
    basename="541查询订阅模板评分",
)
# 新任务集
router.register(
    r"doQiniuLog", views.AllinpayRobotQiniuLogViewSet, basename="61任务历史记录"
)
# soVite
router.register(
    r"doChatAudio", views.NewRebotAudioPostViewSet, basename="62文本合成音频"
)
# hedra功能模块
router.register(
    r"doChatVideo", views.NewRebotVideoPostViewSet, basename="630音频合成视频(停用)"
)
router.register(
    r"todoChatVideo", views.NewRebotVideoDirectViewSet, basename="631音频合成视频(停用)"
)
# lipsync功能模块
router.register(
    r"doLipsync", views.AllinpayRobotSyncPostViewSet, basename="650唇部动作"
)
router.register(
    r"todoLipsync", views.AllinpayRobotSyncDirectViewSet, basename="651唇部动作"
)
# opencv功能模块
router.register(
    r"doOpencv", views.AllinpayRobotOpencvPostViewSet, basename="660单图加音频转视频"
)
router.register(
    r"todoOpencv",
    views.AllinpayRobotOpencvDirectViewSet,
    basename="661单图加音频转视频",
)

router.register(
    r"myShareList",
    views.AllinpayRobotListmyShareViewSet,
    basename="67我的公共好友列表",
)
router.register(
    r"mySharePost",
    views.AllinpayRobotListmySharePostViewSet,
    basename="671我的公共好友创建",
)
router.register(
    r"mySharePut",
    views.AllinpayRobotListmyShareListViewSet,
    basename="672我的公共好友请求",
)

router.register(
    r"changeMoney",
    views.DepositMoneyViewSet,
    basename="68充值修正",
)

# 推广计划
router.register(
    r"appSpread",
    views.AllinpayWxchatSpreadViewSet,
    basename="70小程序推广码",
)
router.register(
    r"valiSpread",
    views.NewUserSpreadViewSet,
    basename="71验证推广计划(关闭)",
)

urlpatterns = [
    path("", include(router.urls)),
    # path("media/", serve, {'document_root':settings.MEDIA_ROOT}, name='media')
    # path("index/", dviews.index.as_view()),
    # path("login/", dviews.login.as_view()),
    # path("dopost/", dviews.upload.as_view()),
    # path("dolist/", dviews.fileList.as_view()),
    # path("uptoken/", dviews.uptoken.as_view()),
    # path("upkey/", dviews.haskey.as_view()),
    path("dosync/", viewc.resSync.as_view()),
]
